import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-22
 * Time: 10:28
 */
public class Test1 {
    public static void main(String[] args) {
        MyLinkedList myLinkedList=new MyLinkedList();
        myLinkedList.addFirst(34);
        myLinkedList.addFirst(3);
        myLinkedList.addFirst(4);
        myLinkedList.addFirst(340);
        myLinkedList.addFirst(344);
        myLinkedList.dispaly();
        System.out.println(myLinkedList.size());
        System.out.println(myLinkedList.contains(4));
        System.out.println("我是分割线");
        myLinkedList.addLast(-12);
        myLinkedList.addLast(-121);
        myLinkedList.addLast(-1222);
        myLinkedList.dispaly();
        myLinkedList.AddIndex(3,999);
        myLinkedList.dispaly();
       // myLinkedList.AddIndex(55,999);
        System.out.println("我是分割线");
        myLinkedList.remove(999);
        myLinkedList.dispaly();
        myLinkedList.remove(344);
        myLinkedList.dispaly();
        myLinkedList.addFirst(-12);
        myLinkedList.addLast(-12);
        myLinkedList.dispaly();
        myLinkedList.removeAll(-12);
        myLinkedList.dispaly();
        System.out.println("我是分割线");
        //myLinkedList.clear();
        myLinkedList.dispaly();
        System.out.println("证明有空行");

        myLinkedList.dispaly();
        myLinkedList.printList(myLinkedList.head);
        System.out.println();
        myLinkedList.print(myLinkedList.head);


    }
}


class Test2{
    public static void main(String[] args) {
        List<String> list1=new LinkedList<>();//会调用无参构造

        List<Integer> list2=new ArrayList<>();
        list2.add(11);
        list2.add(22);
        list2.add(33);
        List<Integer> list3=new LinkedList<>(list2);//使用其它集合容器中的元素构造list3
        System.out.println(list3.toString());

        list3.add(-1);
        System.out.println(list3);

        list3.add(0,-99);
        System.out.println(list3);

        list3.addAll(list2);
        System.out.println(list3);

        list1.add("HELLO");
        list1.add("H");
        list1.add("LO");
        list1.add("LO");
        list1.remove("H");
        System.out.println(list1);

        System.out.println(list1.get(0));

        list1.set(0,"qwerty");
        System.out.println(list1);

        System.out.println(list1.contains("hello"));

        System.out.println(list1.indexOf("LO"));
        System.out.println(list1.lastIndexOf("LO"));

        list1.add("HELLO");
        list1.add("H");
        System.out.println(list1.subList(0, 3));

        //list1.clear();


        System.out.println("这里是分割线");
        System.out.println(list1);

        for (String x: list1) {
            System.out.print(x+" ");
        }
        System.out.println();

        ListIterator<String> it=list1.listIterator();
        while(it.hasNext()){
            System.out.print(it.next()+" ");
        }
        System.out.println();

        ListIterator<String> rit=list1.listIterator(list1.size());
        while(rit.hasPrevious()){
            System.out.print(rit.previous()+" ");
        }
        System.out.println();


    }
}



class Test5{
    void printList(){}
    public static void main(String[] args) {
        List<Integer> list1=new ArrayList<>();
        list1.add(12);
        list1.add(34);
        list1.add(5);
        list1.add(2);
        list1.add(-12);


    }
}